import request from '@/config/axios'

export interface SalesMaterialManagementVO {
  id: number
  orderId: number
  orderNumber: string
  customerName: string
  dictOrderType: number
  productCode: string
  productName: string
  modelSpecification: string
  unit: string
  orderQuantity: number
  orderDate: string
  deliveryDate: string
  remarks: string
  dictStatus: number
  creatorName: string
  updaterName: string
}

// 查询订单管理-出售物资管理-产品编号填写列表
export const getSalesMaterialManagementPage = async (params) => {
  return await request.get({ url: `/order/sales-material-management/page`, params })
}

// 查询编辑订单管理-出售物资管理-产品编号填写详情
export const getSalesMaterialManagement = async (id: number) => {
  return await request.get({ url: `/order/sales-material-management/get?id=` + id })
}

// 查询订单管理-出售物资管理-产品编号填写详情
export const getSalesMaterialManagementDetail = async (id: number) => {
  return await request.get({ url: `order/sales-material-management/producDetails?id=` + id })
}

// 新增订单管理-出售物资管理-产品编号填写
export const createSalesMaterialManagement = async (data: SalesMaterialManagementVO) => {
  return await request.post({ url: `/order/sales-material-management/create`, data })
}

// 修改订单管理-出售物资管理-产品编号填写
export const updateSalesMaterialManagement = async (data: SalesMaterialManagementVO) => {
  return await request.put({ url: `/order/sales-material-management/update`, data })
}

// 删除订单管理-出售物资管理-产品编号填写
export const deleteSalesMaterialManagement = async (id: number) => {
  return await request.delete({ url: `/order/sales-material-management/delete?id=` + id })
}

// 导出订单管理-出售物资管理-产品编号填写 Excel
export const exportSalesMaterialManagement = async (params) => {
  return await request.download({ url: `/order/sales-material-management/export-excel`, params })
}
